Spinach Forest

#WA

/ WA 2020 #7: Wrapping Up Before The End.   / WA 2020 #5: Running Fast Enough   / WA 2020 #4: A Secret of Perfect Taste   / WA 2020 #3: Conway's Law of Thread Pools   / WA 2020 #2: Doc Appointment   / WA 2020 #1: Figure Things Out   / WA 2020 #0: Ten Days, That's The Goal   / With Accent: The Result   / Paying a Careless Tax - WA, #1   / Uncool Monsters - WA, #0   / ... 

WA 2020 #7: Wrapping Up Before The End.

|

I found myself not to afford to write more, which was the original goal. This time I'm too busy, my mental traffic is so congested that I cannot have another task without harming things I'm responsible for.

Still, there are still some findings:

  • I enjoyed writing these. It was fun to write some silly stuff. I love to waste time by these writing attempts. These aren't just affordable now.
  • My writing tends to go too sentimental, and it degrades the clarity. I have to find a way to be more dry, concise and critical. Being emotional is easy, but not helping your thinking.
  • I still have a lot of errors around articles and tenses. It's a shame. I think a continuous practice like this will help improving. It's disappointing that I cannot do it.

Again, it was fun. And I'm pleased that I can still enjoy writing these random stuff. I'll be back some other day.

WA 2020 #5: Running Fast Enough

|

I just finished the audio version of Susan Fowler's Whistleblower. There are a lot of stunning facts covered. One of such saddening points is that the harassing managers came from Google. So in theory, in a parallel universe, it might be Google. Instead of Uber.

Susan Fowler had the dawning thought that she was prepared to fight against Uber. Although it is true that she is prepared, there is no reason that it has to be Uber. I take it more as a probabilistic outcome. Uber is probably the most likely one, as its bad reputation suggests. However, I cannot think other companies, including my employer are perfectly innocent. There is so much evidences being publicly reported. Here is the latest one. The story has so many parallels to the ones from Uber's,  albeit it's a bit more nuanced.

To be clear, I haven't seen such a misconduct around me. All I have is a vaguely memory of a few rumors in this realms from years ago. I'm not sure whether I in the past years took it seriously. I just don't remember how I reacted. If I hear such kind of things today, however, I'll probably believe it. That's the effect of the movement Susan Fowler catalyzed: I no longer hold the level of the belief to my employer. While I still think it's a good place to work overall, I now consider it as a matter of some probability. The odds are on my side, but it can fail.

And the story tells me that it fails miserably if it does. I don't think I'm able to fight against it. The best I can do is probably just running away. To be honest, I'm not that confident that I even have that ability, to run fast enough.

Even before reading this book, I know I can never be like Susan Fowler and that's totally OK to me. After finishing the book, however, I now don't want to be one of the researchers in Physics department in UPenn, who stayed away from Susan once she became "the "problem". Still, I know I'm probably one of them if it happens. I don't know what I should do, how I can prepare. One thing clear is that it's not about running fast enough.

WA 2020 #4: A Secret of Perfect Taste

|

"I found a secret." She said, after perfecting the taste of her potato salad / mashed potatoes. "To make the taste perfect, you can keep adding salt to the salad while tasting it and stop right before it gets too salty."

"It's like the Microsoft strategy for winning." I responded. "In their days they were said that their strategy was to keep running the business until they won, pouring money into it until competitors gave up." Twenty years ago, it sounded like a perfect strategy. Looking back, however, I cannot help but wondering - How many businesses had they won through this? Maybe their game console deserves the exemplar position. On the other hand, there are numerous counter examples. Think about their server market, which has lost to Linux, or mobile. A lesson from this quick lookback is probably something like this: The words from the winner sounds like the truth but you cannot tell.

That being said, I still have some respect for their commitment to the business continuity. My employer is famous for the business discontinuity. I used to think that it is reasonable, or at least make some sense. I'm not sure anymore. Instead I now believe Microsoft indeed won some ground with the strategy, and it must have paid off overall. It is just not a perfect strategy. There is no such thing.

Of course I didn't keep talking like this. That is not how couples talk. Here is what actually followed: "I think I read the same idea in Salt, Fat, Acid, Heat. I followed that advice for a while, but then noticed that it doesn't work on some occasions: Think about marinated chicken for example. You cannot taste the marinade, especially when you use some alcohol. You have to commit to some recipe, and all you can do is adjust it for each iteration."

In a sense the continuous-tasting secret resembles Agile Software Development, or Lean Methodology. You experiment, measure and adjust. In some cases, this works perfectly. For some others though, this doesn't make a lot of sense. There are software counterparts of the marinade - You have to commit. You can iterate only slowly. The perfection takes time and the early in-market does create the moat. Should you avoid software projects that's hard to experiment with? Now you know this a silly question - It's like asking you should avoid marinade. Fine. You can. But are you happy with it?

Of course I didn't keep talking like this. That's not how couples talk. Here was what actually followed: "But it works perfectly when it does. Give me a scoop. Wow this does taste perfect!"

WA 2020 #3: Conway's Law of Thread Pools

|

The mobile app I'm helping to build at work has stunning number of threads and it's been complained by the system health related teams, who are monitoring the apps built in the organization and alert their developers as needed.

One day, an engineer from a neighboring team filed a bug that said "the app has too many threads". I was furious - Their teams is responsible for large part of it, and you just throw the shit to us and ridicule us? What a rude guy. I was furious also because their team has been contributing to the app unstability for a long time and debugging it has wasted a lot of my time. But this kind of them-vs-us mindset never solves any issue, so I just left the bug open and moved on (which doesn't solve any issues either, literary, but at least I don't make it worse.)


People casually create thread pools. In many cases that's not a problem. Each thread isn't that expensive after all. However, if a lot of teams who are developing compute-intensive features come together and put their efforts into a single app, each increment is gradually harming the performance.

How expensive are threads? Talking about thread overhead, the first thing people care about is the memory. Thread does allocate some memory, but the actual number is not clear. In addition to the linux thread, an ART thread is attached to each thread on Android.

In practice though, the thread creation latency becomes more like a problem than the thread heap consumption. The thread creation is serialized, blocking other threads. Even without that, it does a lot at the beginning of the thread lifetime, and its CPU consumption is visible in a startup trace data.

In short: Threads can be heavy in memory, but thread creation latency is more evident harm.


Why do teams create itstheir own thread pool instead of sharing it? Because it's easier. Creating a new one is one liner but passing around thread (or Java Executor) needs some plumbing, especially it crosses the team boundary. Also, it is often safe to have a new one if you need specific semantics, like serialized execution on a single thread. Java doesn't have a way to express these characteristics of an Executor.

If you think a bit more, you would realize that you can implement the serialized semantics over an existing thread pool. Guava's SequentialExecutor implements it for example. People just don't care. Another evidence that people don't care is that everyone creates the thread pool with number of thread as the device's CPU count. What a f*** - Multiply it with the number of thread pools. How does it possibly make sense. (I know it does in a few occasions, but it doesn't help me from the complaints from the other side.)

Java or Android could have had some API that returns an Executor with desired property but is backed by a system-(or process-)wide thread pool. That didn't happen. Whom to curse?

Using native (C++) code in the app makes the situation way worse: There is no obvious way to share threads (or thread pools) between C++ and Java. As a result, same people create separate thread pools in C++ in addition to ones in Java.


The number of thread is now the number of CPU cores multiplied by the number of participating teams plus the number of async-but-serialized executions multiple by the number of programming languages. This is crazy. And that's why the number of threads in our app is crazy large.

Solving this problem is technically trivial: You can build a cross language thread pool library that has thread sharing in mind. But it's more about organizational problems: You have to convince other teams to use that library. You have to demand other teams extra work and complexity. You have to convince that your design is right, eschewing the endless bikeshedding, while you have deadlines, as well as do others.

I don't have energy to go through all of these, but probably I should start building something small and start using it in our own codebase, then go to the rude neighbor, and then pitch it to the research org, etc, etc... Oh god it's depressing. Stop thinking too much and just start small. Later.


Another side of me appreciates where I am - It's much better to have at-least-partially-technical problems stacking up in front of myself, instead of having the need to looking around to find even niche problems to solve, or having a not-at-all-technical problems in front of, but not reachable from, me. For me a hired professional, problems I have are bread and bacon.

WA 2020 #2: Doc Appointment

|

As instructed by my primary care doctor, I visited a specialist. I was supposed to have a pulmonary (lung) function test, but the doc said his office doesn't have the facility and I have to make another appointment to the hospital nearby. What a waste of time; What's the point of the specialist?

Without waiting for the test result, he prescribed a long-term control medicine for asthma. Why don't we wait? I was nervous, but kind of expected it. After all, asthma is very a vague categorization and the perception of the patient (me) matters a lot. And I went to the doctor, suggesting I consider myself an asthma sufferer.

Reading through the instruction of the medicine, the long list of the side effects scares me a lot. I hope I don't have to use this, but "long-term" means this is likely to become my lifelong medication. Sigh.


I was fed up with the series of my doctor visits. It's not close (20 min drive) and their office work is far from efficient. My primary care doctor/provider (PCP) hasn't shown up after my very first visit but only her subordinate NPs do. The specialist today was as blunt as I almost took it as an arrogance. I hate all of these.

My spouse has her PCP in a big hospital. It has its own strengths and weaknesses. One strength over my current mediocre small medical center is the streamlined services and the doctor's average quality of the service. The drawback is the long queue of appointments. Last week I asked her how long she had to wait for the possible next appointment. The closest date, it turned out, was about a month away. I'm not sure that is a good option. Even though my current situation is messy and has tedious arrangement, I can at least make an appointment in a few days.

Yet another option for me is the employer-provided medical center. I didn't like the idea of letting my life depending on the employer beyond the paycheck and I didn't have high expectations regardless. However, a friend of mine tried it and told me that he was very much satisfied. According to him, it has a couple of advantages over my current situation: First, the appointment latency is very short, which is a big plus. Also they are located on-site, meaning very close to my office. I would no longer have to pay about an hour plus $20 Uber fee for each visit. It'd be another big win. And so far I don't see any real shortcomings. Probably I should, and will, take a look - Once this asthma round is over.


I didn't like the employee-based services because I feel spoiled and I miss the opportunity to see "Real America." I don't have such an aspiration anymore though. Life is too hard to chase the reality behind the curtain. Now I'm happy to be illusioned.

 

WA 2020 #1: Figure Things Out

|

A teammate came back from his business trip to a remote office in Asia. I found that I've missed him.

Let's call him T.  T is the one I talk the most at work, and he's the one who has interesting topics. My work days were quiet while he was traveling. And that's over.

T traveled to talk to the people below the tech stack. I and T have been talking about adding some corner-cutting private API across the stack for performance optimizations, but we knew too little about the lower layer to make it happen. So the goal of his trip was to figure the plan out with the team who know the needed details.

T went there because this is his project. At the same time, he went there on my behalf because it's also my project. Precisely speaking, it is still not a proper project with substantial commitment, but we want to make it real. T took action for that while I didn't.

T figured it out, but he probably wouldn't make it, that is, he probably wouldn't write any code for that. That's likely to be my part.

That's because ... T is a manager, specifically a TL-M. A tricky part is that he's not my manager. He did the legwork not because his reportees needed it but because he thought it was important for hitting bigger goals, for which I'm also responsible.

I feel bad for him - Probably I should've traveled instead of him, or at least we should've gone together. Or he should be able to work on the whole project by himself. The talk-code separation invites bureaucracy. I hate it, but I realized I just did call it.

I've been frustrated by my lack of the action, but I'm almost giving it up. Why do I have to depend on him? Why does he have to depend on me? Why cannot we pursue these technical challenges from the beginning to the end by each of ourselves?

This question can be easily answered in a way that critics do. But I would reject that. It's just a noise unless being actionable. I'll figure it out. Meanwhile, T has a bumper-sticker message in the intranet profile page. It says: Figure Things Out.

WA 2020 #0: Ten Days, That's The Goal

|

My English ability is declining - This is the feeling I have often these days. Although I've been accepting the fact that my English fluency is not getting better, having decline is different. I have struggled to articulate my engineering points to my teammates, which feels like a real threat.

More practice is needed, probably speaking, but writing is easier. So I decided to start some writing practice: I'll write some random trivial stuff once a day for ten days. I expect it to be plain diary and do not expect it to be worth a read. That aims to be pure practice.

What should I write about today, then? Here you go...


Why is my English fluency declining? There are several contributing factors.

First of all, I have spent no time on explicit English practice. I simply cannot afford it. This isn't great, but it's just a plain fact.

Secondly, I've largely withdrawn from podcast listening for a month. I still listen time to time, but my phone no longer has any podcast app installed. The intention was to spend more time on long-form audio books and my own thinking, and it paid off. However, thinking more to me means thinking in Japanese, and also listening to written English like Audiobooks isn't like listening to people speaking and somehow doesn't have the language gravity podcasts had. It might be matter of taking back podcasts again to my life, but somehow doesn't feel like that today.

Relatedly, I feel myself in a kind of introspective mode these days. I like to be introspective, but it's not a great way to be aware of languages. What's worse, my introspection is solely done in Japanese.

Probably I should spend more time on consuming spoken media, talking to people and thinking in English. I don't feel like that, but there needs to be some balance to hit. This writing project is a not-so-promising attempt to hit the balance.


By the way, have you tried Google Docs' spell checker recently? It's amazing. I wrote the text above in a single path, and pasted it to a gdoc, and edited based on the suggestion. I underscored such edits. I guess I could've spotted some of them if I re-read, but all of t hem. It's worth highlighting - It tells me my misspelling patterns.

Anyway, spell checker. It's worth a shot. (I guess GMail is now using the same checker, but I'm not sure.)

Edit: I've made several edits after the spell checker applied. There are endless mistakes and rough edges.

With Accent: The Result

|

I ended up making eight posts last month, which is a lot fewer than other months.

This small project proved my lack of writing ability in the language. It takes longer, it is harder to articulate ideas, and the hardest part is that, it is so burdensome that I virtually cannot think while writing: The idea has to be clarified enough before being written down. It hampers the purpose of writing, as I write to think.

I'll keep this project as a kind of exercise for a while, probably by doing bi-monthly: In coming odd months I'll write with the accent.

Paying a Careless Tax - WA, #1

|

Yuko pointed out that I lost our baby stroller. Apparently I lost it at the end of our Japan trip last month. I remember that I received it at the baggage area of the airport, but I don't remember anything after that. Probably it was left in a shuttle or somewhere.

The stroller was relatively expensive one, about $400. So this loss costs as such. I paid the Careless Tax.

I often lose things, especially during a trip, or while I'm doing something out of my regular routine. I lose things so often that I once feared that I might eventually lose everything I have - My job, my friends or my family, due to my profound carelessness.

This was very dreadful thought but I couldn't stop pomdering. After some depressing nights with this ridiculous fear, I devised as an ridiculous idea. The notion of the Careless Tax.

Instead of thinking about losing stuff, I interpret it as a tax. A tax that careless person has to pay. It is unavoidable to pay if it's a tax. And for a careless person like me, it is actually unavoidable to lose belongings. You aren't careless if you can prevent it, which is almost by definition. I have felt it unreasonble and even unfair how often I lose stuff. But it makes sense presuming it being a tax.

Since then, this notion of "Careless Tax" has given me a tiny piece of mind. It is less scary to think about me keep paying this expensive tax, than imagining about me losing everything. I can even be pround of myself as a high tax payer!

Well, that's clearly an overstep. I'm just an inherently careless person and it costs a lot, not of irreplaceable belongings, but of money. Tiny consolation, isn't it?

Uncool Monsters - WA, #0

|

Today as a halloween night, we had a couple of small guests, but they weren't like we expected.

"Hi" one guest said.  Another one stayed silent. Both had bags, apparently for treats. "Are you two?" I asked. They nodded. I gave them some snacks that we prepared. "Happy Halloween!" I said. "Thanks",  one mumbled. Then they left quietly.  There was no smiles, no "trick or treat", just a presumption of how we were supposed to behave.

Even though such an encounter wasn't expected, I see how these kid felt - For socially awkward types, or for ones being cool, participating traditional events like Halloween must be uncool and undesirable. It'd be much better to stay home and play video games, they must have thought.

There is a mixed feeling. As a nerd, I totally share their (hypothetical) sentiment and feel sorry for them. As a parent at the same time, I feel sorry for them in a different way. It's unfortunate not to have the ability to enjoy this type of banal rites. Anything can be fun if you will, and the life would be much more enjoyable if you take that position, instead of attempting to stay cool.

Now I look at my distant past self. You could've enjoyed your life if you have taken another position, but I know you would've never heard such an advice, never. But you'll eventually find that being cool is sometimes uncool.


WA or "With Accent" is my irregular attempt to write stuff in English. This time I'll try running this for a month, during this November.