ABAP Performance Test: Hashed Tables vs Database Buffers

There are two significant techniques to avoid repetitive access to database records: Hashed internal tables and database buffers. We ignore other internal table types because hashed tables are proven to be the fastest approach when reading single records.

If we decide to use the former method, we need to get the database record into a hashed internal table. Whenever we need to access the record, we read the internal table instead of the database table.

If we decide to use the latter method, all we need to do is to activate the table buffer in SE11. If we do that, the accessed data is cached on the application server, and the cache is used whenever possible. Thus, database access is reduced. There are exceptional cases where the buffer is bypassed, but that’s beyond the scope of this article.

Wondering how they compare in terms of performance, I created a fully buffered database table with example data.

Screen Shot 2017-10-20 at 19.12.24

I also wrote a program, which accesses the data using both techniques and compares the runtime.

It turns out that hashed access is 3-4 times faster than database buffering.

Screen Shot 2017-10-20 at 19.14.15

You can use the attached source code yourself and repeat the test; I would like to hear about any disproving results.

REPORT zdummy01.

CLASS main DEFINITION.
 PUBLIC SECTION.
   CLASS-METHODS execute.
 PROTECTED SECTION.
 PRIVATE SECTION.

CONSTANTS:
 c_do_times TYPE i VALUE 100,
 c_matnr TYPE matnr VALUE 'M1'.

CLASS-DATA:
 go_text TYPE REF TO cl_demo_text,
 gv_begin TYPE i.

CLASS-METHODS:
 hash,
 select,
 start_chrono,
 stop_chrono.

ENDCLASS. "main DEFINITION

*----------------------------------------------------------------------*
* CLASS main IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS main IMPLEMENTATION.

METHOD execute.

  go_text = cl_demo_text=>get_handle( ).

  start_chrono( ).
  hash( ).
  stop_chrono( ).

  start_chrono( ).
  select( ).
  stop_chrono( ).

  go_text->display( ).

ENDMETHOD. "execute

METHOD hash.

 DATA:
   lt_dummy
   TYPE HASHED TABLE OF zdummy01
   WITH UNIQUE KEY primary_key COMPONENTS matnr.

  FIELD-SYMBOLS:
   <ls_dummy> LIKE LINE OF lt_dummy.

  go_text->add_line( 'Starting hash read' ).

  SELECT * INTO TABLE lt_dummy FROM zdummy01.

  DO c_do_times TIMES.

    READ TABLE lt_dummy
      ASSIGNING <ls_dummy>
      WITH TABLE KEY primary_key
      COMPONENTS matnr = c_matnr.

  ENDDO.

ENDMETHOD. "hash

METHOD select.

  DATA ls_dummy TYPE zdummy01.

  go_text->add_line( 'Starting select' ).

  DO c_do_times TIMES.

    SELECT SINGLE *
      INTO ls_dummy
      FROM zdummy01
      WHERE matnr EQ c_matnr.

  ENDDO.

ENDMETHOD. "select

METHOD start_chrono.
 GET RUN TIME FIELD gv_begin.
ENDMETHOD. "start_chrono

METHOD stop_chrono.

  DATA:
    lv_diff TYPE i,
    lv_difft TYPE cl_demo_text=>t_line,
    lv_end TYPE i.

  GET RUN TIME FIELD lv_end.
  lv_diff = lv_end - gv_begin.
  WRITE lv_diff TO lv_difft LEFT-JUSTIFIED.

  go_text->add_line(:
    'Runtime result:' ),
   lv_difft ).

ENDMETHOD. "stop_chrono

ENDCLASS. "main IMPLEMENTATION

START-OF-SELECTION.
 main=>execute( ).

 

Advertisements

Fodera vs Fender Custom Shop

In this post, I will subjectively compare two high end basses.

One of them is a Fodera Emperor Standard Classic 5 with an alder body and rosewood fingerboard – everything is stock. The other one is a (discontinued) Fender Custom Classic Jazz Bass V with an alder body, rosewood fingerboard and noiseless Bartolini 57J1 L/S pickups.

Before reading further, you might want to check the following posts for some technical details:

Comparison

Versatility: Fodera enables me to switch between humbucker / single coil and active / passive modes. It also has a passive cut control which works in both active / passive modes. Therefore, it has more onboard tonal versatility than the Fender.

Noise: Fodera has 60-cycle hum in single coil mode; which can be eliminated in humbucker mode. Fender is totally noiseless. Therefore, Fender has an advantage in cases I need to play in soloed single coil mode. For the record; stacked noiseless pickups are notorious for being weaker – that’s why I keep split coil Bartolini’s on my Fender.

Articulation: Overall; single coil articulation of Fodera is clearer than the Fender.

Effects: Fender has ceramic pickups, which (in my subjective opinion) work better than Fodera’s alnico pickups in case I need to use high gain. The advantage intensifies in single coil mode due to the hum of the Fodera.

Sound: I mainly use 4 sounds.

  • P-bass sound: Fender nails this sound better because I must use the Fodera in humbucker mode when I solo the neck pickup (due to hum).
  • J-bass sound: I would say that Fodera and Fender go head-to-head producing an acceptable J-bass sound.
  • Jaco sound: Emphasizing the bridge humbucker, the Jaco sound of the Fodera pleases me better than the Fender.
  • Solo sound: Single coil bridge pickup of the Fodera is more articulate and preferable than the Fender. However, it will hum. Therefore; Fender takes the lead in case noise would be a problem.

Neck: Fodera has the most comfortable neck I have ever played.

Price: Fodera is more expensive than the Fender – I think that it is worth it though. Having said that; I should add that they belong to the same price segment.

Conclusion

The Fodera is more versatile, articulate, comfortable and has the edge on bridge sounds. The Fender is completely noiseless, works better with effects, can be carried around insouciantly and has the edge on neck sounds.

As you see, none of the basses is absolutely better than the other. They are simply different. As discussed in Diminishing Returns on Bass Prices ; this would be the case in most situations where you compare two basses from the same price segment.

Frankly; I could pick either of them as my desert island bass. So how would I pick the bass to leave home with?

Currently, my decision mostly depends on the following question: “Can I keep my bass with me all the time today?” If the answer is yes, I pick the Fodera. Otherwise, I pick the Fender. Me being a Fodera artist, this may seem like an obvious choice. However; since the Fodera is harder to replace, I’m holding on to it.

I hope to play them both for many years though. Thus; I keep a spare Yamaha TRB 1005 as a stunt bass for obviously dangerous situations, such as gigs on the beach.

Diminishing Returns on Bass Prices

I talk about diminishing returns on multiple posts about bass prices. I would like to explain what it means. Basically; “diminishing marginal return” means that the difference you get per $ decreases dramatically after a certain price point.

I would expect the quality difference between a 500$ bass and a 2.000$ bass to be much greater than the quality difference between a 2.000$ bass and a 6.000$ bass.

In other words; I would expect a 2.000$ bass to have a much higher quality than a 500$ bass. However; a 6.000$ bass wouldn’t differ that much from a 2.000$ bass.

After a certain point, we can’t even speak about a “better” bass, but we can speak about a “different” bass which is not necessarily better or worse than the cheaper one.

Makes sense, right?

My Fodera vs Fender Custom Shop comparison provides a “case in point” demonstration of diminishing returns. Both have their strengths and weaknesses, but none can be considered absolutely “better” than the other.

Agartha Festivali’nde Sahne Al(a)madık

Shamoon olarak, 25-30 Ağustos 2017 tarihleri arasında Salda Gölü’nde yapılan Agartha Festivali‘nde yaşadığımız mağduriyeti kamuoyu ile paylaşmak istiyoruz. Amacımız, benzer mağduriyetlerin yaşanmaması.

Festival organizatörü İlker Ayas ile festivalden uzunca bir süre önce temasa geçerek, 26 Ağustos Cumartesi günü sahne almak ve ulaşım maliyetimizin karşılanması konularında mutabık kaldık.

Yol ücretini gelmeden önce istememize rağmen, Salda’ya vardığımızda alacağımız belirtildi. Durum bize alışılmadık ve şüpheli gelmesine rağmen; aramızda konuşup bu riski almaya karar verdik.

25 Ağustos Cuma günü Salda’ya vardık. Ses sistemini incelediğimizde; bize vaadedilen ekipmanın mevcut olmadığını gördük – ancak belki de başka yerde muhafaza ediliyordur diye İlker Bey’i aramaya koyulduk.

Festival alanına gecenin geç saatlerine kadar 3-4 kez gitmemize rağmen İlker Ayas’ı bulamadığımız gibi; sahne almamız gereken 26 Ağustos Cumartesi günü de kendisine ulaşamadık. Neden sonra telefonla ulaşabildiğimiz İlker Bey; bizi arayacağını söyledi ancak aramadı.

Sonuç olarak; sahne alamadığımız gibi, ulaşım maliyetimiz de karşılanmadı.

Tesellimiz; Salda’nın muhteşem doğası & samimi güzel insanlarıyla tanışmak ve küçük bir tatil yapmak oldu. Oraya kadar gitmişken biraz da çekim yaptık.

Gerek yüz yüze konuştuğumuz kişilerden; gerek Ekşi Sözlük, Facebook gibi sosyal medya sitelerinden edindiğimiz intiba; festivale giden pek çok kişinin de mağduriyet yaşadığı yönünde idi. Bilet başı 300 lira ödenen bu festivalin parasını haketmediği konusunda pek çok şikayet var. Salda sakinlerinin gürültü sebebiyle emniyet güçlerini harekete geçirdiği de kulağımıza geldi.

İlker Ayas’ın herhangi bir organizasyonunda bir daha sahne almayacağımızı kamuoyuna duyururuz. Benzeri mağduriyet yaşamak istemeyen müzisyen arkadaşlarımızın ve takipçilerimizin dikkatine sunulur.

Is Fodera Worth The Money?

There is a great debate on the price segment of Fodera basses. Some people think that they are overpriced, some think that they can justify the price tag, and some people own multiple Fodera basses. Apparently, the only consensus is that they aren’t exactly the cheapest purchase option in the bass market. Being a Fodera artist myself, I would like to talk about this matter.

Many other renowned custom builders work within the price range of Fodera as well; therefore, the title of this post could have been “Are custom basses worth the money?”. However; I didn’t want to talk about basses I’ve never played before, so I focused solely on Fodera.

Value

First things first: Value is a subjective concept. Some people drive a Mercedes and can justify its high price with tangible or intangible factors; while others think that it is overpriced and any middle class vehicle can get them from point A to point B.

Same applies to the value of bass guitars; where Fodera can arguably be seen as the Bugatti of the market.

At Fodera, very talented luthiers hand-produce bass guitars using very high quality wood and hardware in a relatively expensive area of the world – NYC. Wage, material cost and overhead per instrument is probably much higher than a typical mass produced factory instrument. Add some profit on top of that. Add some customer service percentage too. Considering that Fodera has a backlog of 9 months on custom instruments, the demand – supply balance certainly seems to be favoring Fodera in terms of an increased price based on brand value as well.

The combination of those factors naturally lead us to the hefty price tags of instruments made by Fodera.

Is it worth it?

To some, yes. Some people enjoy the sound, playability, overall quality, image, etc. of a Fodera so much that they will find the instrument worth it. Some of those are financially fortunate enough to buy one, some not.

To some, no. Some people will find the instrument overpriced and claim that they find a similar sound, playability, overall quality, image, etc. in another instrument.

It all boils down to what you seek in an instrument, and where you can find it. Tangible or intangible; some people seem to find their criteria in a Fodera, and find the instrument worth it. The equation is that simple. Others might find their criteria in another brand (expensive or cheap), which is also totally fine.

Check my Fodera vs Fender Custom Shop comparison to see the reasons why a particular player might prefer the Fodera over a Fender CS or vice versa.

Diminishing Returns

To be fair, we have to consider the law of diminishing marginal returns.

Assuming that a good production bass costs 2.000$ and an entry level Fodera costs 6.000$; some people will find the difference of Fodera worth the additional 4.000$ because this is what they are looking for. This is fine.

Some people will happily settle down with the 2.000$ bass and think that Fodera is overpriced because both sound & play almost identical for them – considering their own requirements. Those people will think that a Fodera is not worth it for them, personally. This is fine as well.

Some people will make a lucky purchase of a 500$ overseas instrument, where the perfect combination occurred; and be perfectly happy with it after a few modifications here and there. They will think that neither the Fodera nor the 2K bass is “worth it”. This is also perfectly fine.

My Subjective Opinion

Although I bought my Fodera second-hand, it cost me a small fortune. But was it worth it? To me, yes. Fodera has always been the holy grail of bass guitars for me, and I feel privileged to possess one. The neck simply plays itself, the tone speaks to me, its versatility is very high, and I simply enjoy having & playing a Fodera; it motivates me to play more and better. What more can I ask for?

On the other hand, my secondary bass Yamaha TRB 1005 costs the fraction of a Fodera, and is still a very good bass guitar I happen to enjoy playing a lot! If I can’t take my Fodera to some gig / practice for some reason, that’s where I play my Yamaha; but it also plays & pleases very nicely. The difference is evident, but not dramatic. Despite that, I subjectively think that Fodera is worth its price. Given the choice, I would take my Fodera for most gigs or sessions; and it is the first instrument I reach for when I’m at home.

I was notorious for buying & selling too many basses, seeking the instrument that speaks to me. My Fodera has been the final destination of my search; I wish that I could have one earlier. The cost of buying & selling too many instruments could be more than the difference between a decent production bass and a Fodera – another point of view in terms of value.

Conclusion

All in all, the world would be a boring place with only one brand and model, wouldn’t it? We are blessed to have so many alternatives corresponding to different needs and financial positions. The instrument that fulfills your subjective hygiene criteria will be “worth it”.

That being said; I think that it is important to distinguish between needs & desires when making a purchase, and decide wisely what is within your budget and what is not.

Tecrübesiz Yeni Mezun Danışman Adayları

Bugün; yeni mezun bir arkadaşımız bana CV’sini göndererek, SAP danışmanlığına adım atmak istediğini ve tavsiyelerimi merak ettiğimi söyledi. CV’yi incelediğimde, üniversite hayatı boyunca herhangi bir SAP tecrübesi kazanmadığını gördüm. Kendisine verdiğim tavsiyeleri; başkalarına da faydalı olabileceğini düşünerek herkesle paylaşmak istiyorum.

Selam, CV’ni inceledim. Gördüğüm kadarıyla SAP tecrüben yok. Şahsen tanışmadığımız için, seni kişilik özelliklerini baz alarak da uygun bir yere öneremem.

Ara sıra SAP danışmanlık firmalarının Junior alımları veya danışman yetiştirme programları oluyor. LinkedIn üzerinden Türk danışmanlık firmalarını takibe alarak bu dönemleri kollamanı tavsiye ederim.

Bunun yanı sıra; kişisel Web sitemin FAQ bölümünde SAP kariyeri ile ilgili oldukça faydalı olacağını tahmin ettiğim bazı kaynaklar var, bunları da incelemeni tavsiye ediyorum.

Yapıcı bir karşılaştırma yapmak gerekirse; CV’si elimden geçen pek çok yeni mezunun, okuldan iş tecrübesiyle mezun olduğunu görüyorum. Ya yazları, ya da okula paralel yarı zamanlı olarak gelecekteki mesleğine istinaden tecrübe kazanmış kişiler daha çok tercih ediliyor.

Dolayısıyla; “ilk işe atılan herkes gibi tecrübesizim” ifadesi pek geçerli değil. Hobilerin ve yurtdışı tecrübesinin insanı çok geliştirdiğini savunan biri olmakla birlikte; işe alım kararı veren kişilerin CV’de aradığı şey hobi değil sıcak iş tecrübesidir. Bir modülün başında hemen iş yapabilir hale gelmiş biri tercih edilecektir.

Bu moralini bozmasın, bu tecrübelerin karşılığını daha uzun vadede alacağından şüphem yok. Ancak, sıcak tecrübe konusundaki açığını kabul edip onu kapatacak çalışmalar yapmanı öneririm. Eğer maddi açıdan karşılayabilirsen, SAP’nin veya yetkili bir kurumun eğitimlerine katılıp sertifika alabilirsin mesela. Bu tarz bir sertifika, istediğin gibi bir pozisyon bulmanı kolaylaştırır.

Seni şahsen tanıyan ve kişilik özelliklerine kefil olabilecek birinin sektöre tavsiye etmesi de etkili olur. O zaman sertifikaya belki de gerek kalmadan, en azından birkaç aylık bir deneme süresinde mutabık kalarak kendine bir pozisyon bulabilirsin. O pozisyonda kendini ispatlamak da sana kalmış.

Architect vs Developer Responsibilities

Responsibilities of an architect and a developer don’t solely depend on the employees role; it also depends on the project and company type. Let me give you an overview based on my personal experience in Turkey.

Support Agreements

A support agreement is the situation where a SAP client makes a deal with a consultancy company to resolve their daily issues over tickets. In that case, the consultant is responsible of understanding the issue, solving it, making the users test it and eventually transporting the solution to the live system. One of the significant responsibilities is to resolve the tickets quickly if the matter in hand is urgent. This sometimes involves working late or at weekends.

Usually; companies agree on response time for priorities. For example; urgent tickets might expected to be replied within an hour & resolved within 24 hours, while low level tickets might expected to be replied within 24 hours & resolved within a day. In that case, this scheme would also act as the KPI of the support consultants. At the performance evaluation at the end of the year, their actual response & resolution rates are compared against the targets. This can run on team and/or personal level. FTR (first time right) is another typical KPI, which indicates the percentage of tickets where the first technical reply got accepted by the client.

In typical support deals, we rarely see architects get involved. Support issues are basically small corrections or enhancements on an existing system, so no architects are full time present. In case a correction needs modification on the fundamental level or some supervisory advice is needed, that’s where they step in. Knowing and understanding the bowels, standards and deep infrastructure of the system much better than developers, the architect can make those fundamental modifications accurately and risk free. Alternatively, the architect can guide the developer on how to proceed – that’s also possible. Whenever a developer without architectural knowledge attempts to do a fundamental change, we usually see anti-patterns emerge.

You can imagine it like this: You can hire a worker to paint your walls, no architect needed. But in case you want to expand your swimming pool, you ask your architect first.

Implementation Projects

This is the deal where a consulting company implements a new functionality to a SAP client. It can be a huge fresh SAP implementation, or a mid-sized implementation of a new functionality over an existing system; or even an upgrade. That’s where ideally developers work under the supervision of an architect.

Each project has a number of tasks to complete. On shallow tasks, the developers would be allowed to directly start with the development. However, the architect walks in for bigger developments, frameworks, integrations and similar comprehensive tasks. The architect usually designs the framework, does the low level coding, does a few demo implementations, and leaves the rest to developers. Other developers build on top of what the architect has prepared.

If I had to list some typical responsibilities on top of my head; an architect would be resposible of:

  • Defining the development standards, naming conventions and document formats
  • Technical supervision to functional consultants during the analysis phase
  • Supporting time estimations
  • Acting as an objective technical authority in meetings
  • Communication and agreement with non-SAP architects on integration points
  • Supervision to project management for task distribution
  • Architectural design & development of complex applications
  • Framework design & development for applications sharing a common ground
  • Supervising developers so they don’t re-invent the wheel
  • Review & validation of code from developers
  • Prevention of code duplication
  • Pursuing and evaluating test results
  • Pursuing architectural, technical, performance and usability excellence
  • Early recognition & proactive measures of architectural risks; such as contradicting or overlapping requirements
  • General responsibility of the big picture

If I had to do the same for developers;

  • Writing clean, understandable, optimized code with enough comments
  • Complying with technical standards of the project and global best practices
  • Re-using code whenever possible
  • Maximizing information flow with co-workers and the architect
  • Finishing tasks on time
  • Supporting tests and correcting bugs
  • Consult the architect on uncertain cases

Pre-Sales

This is the case where the consulting company wants to sell a product or service to a potential client.

In such cases, presence of the architect is more than welcome due to a lot of reasons; of which some are listed below:

  • Knowledge of the architect would positively influence the client
  • An architect can conclude technical discussions with the client’s employees rather quickly
  • In case a demo application is needed, an architect can understand, plan and implement it very well; demonstrating the technical muscle of the consulting company
  • An architect can inform the sales team of technical limitations and regulations; proactively stopping them from making unfulfillable promises
  • Accuracy of development time estimations would increase

Conclusion

The picture I painted in this article is far from complete; however, I think that it gave you the overall insight you needed. In summary; you can imagine the developers like construction workers, and the software architect like a, well, architect (doh).